<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <link rel="stylesheet" href="model.css" />
  
   <?php include("head.php"); ?>
 <?php include("entete.php"); ?>
   <?php include("menu.php"); ?>
<?php


try{
  $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
  $bdd = new PDO('mysql:host='.DB_SERVER.';dbname='.DB_DATABASE, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, $pdo_options);
  

  $id_assoc = $_GET['idAssociation'];
  $nom_assoc = $_GET['nom_assoc'];

  $sql = "DELETE FROM ASSOCIATION WHERE ID_ASSOC = '$id_assoc'";

  $bdd->exec($sql);

  $sql ="DELETE FROM FINANCEMENT WHERE ID_ASSOC='$id_assoc'";

  $bdd->exec($sql);

  echo $nom_assoc.' a bien été supprimé';
  
}
catch (Exception $e)
{
  die('Erreur : ' . $e->getMessage());
} 
?>

<?php include("pied_de_page.php"); ?>